-
Notifications
You must be signed in to change notification settings - Fork 915
Replace all uses of 'interface{}' with 'any' in the mongo/ packages. #2139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
API Change ReportNo changes found! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Replace all uses of interface{}
with any
in the mongo/ packages to adopt the cleaner syntax introduced in Go 1.18. This is a purely syntactic change with no semantic differences since any
is a type alias for interface{}
.
- Replace
interface{}
withany
across all function parameters, return types, struct fields, and variable declarations - Update function signatures in the MongoDB driver APIs to use the more modern syntax
- Maintain full backward compatibility as this is only a type alias change
Reviewed Changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
mongo/writeconcern/writeconcern.go | Update WriteConcern struct field type |
mongo/with_transactions_test.go | Update transaction callback function signatures |
mongo/single_result.go | Update function parameters and return types |
mongo/session.go | Update WithTransaction method signature |
mongo/search_index_view.go | Update struct fields and method parameters |
mongo/results.go | Update result struct field types |
mongo/options/ (multiple files) | Update option struct fields and method parameters across all option builders |
mongo/mongo.go | Update core marshal/unmarshal function signatures |
mongo/index_view.go | Update IndexModel struct and method parameters |
mongo/gridfs/ (multiple files) | Update GridFS-related types and method signatures |
mongo/errors.go | Update MarshalError struct field type |
mongo/doc.go | Update documentation comments |
mongo/database.go | Update database method parameters |
mongo/cursor.go | Update cursor method signatures |
mongo/collection.go | Update collection method parameters and internal types |
mongo/client.go | Update client method parameters and struct fields |
mongo/change_stream.go | Update change stream related types |
mongo/bulk_write.go | Update bulk write related types and method signatures |
mongo/batch_cursor.go | Update interface method signature |
mongo/background_context.go | Update context method signature |
🧪 Performance ResultsCommit SHA: 3f726dfThe following benchmark tests for version 689a3b15aaf5e20007e657d7 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
Summary
Replace all uses of
interface{}
withany
in the "mongo/" packages.Background & Motivation
any is a type alias for
interface{}
, so is semantically identical. The only change is a slightly cleaner syntax.